Issue 52900: LKSM: Moving a sample to another folder breaks other references to shared files#6699
Issue 52900: LKSM: Moving a sample to another folder breaks other references to shared files#6699
Conversation
Issue 52900: LKSM: Moving a sample to another folder breaks other references to shared files Issue 53070: Moving files could result in duplicate exp.data records
|
|
||
| public String getSourceSelect(SqlDialect sqlDialect) | ||
| { | ||
| String schema = sqlDialect.makeLegalIdentifier(_table.getSchema().getName()); |
There was a problem hiding this comment.
@labkey-matthewb Any suggestion how to avoid using the deprecated makeLegalIdentifier here is appreciated.
There was a problem hiding this comment.
Agreed. It is helpful when deprecating methods to give indication as to what should be used/considered instead.
There was a problem hiding this comment.
This doesn't really have anything to do with SQLFragment and identifiers, if we're just trying to create a string literal to select. Just create the string you want and use appendValue() instead of append()
There was a problem hiding this comment.
Are using this selected string to generate SQL later (or is this just for logging/display)? If so it's probably easier to select the schema and table name separately.
| selectFrag.append(" NULL AS SourceKey,\n"); | ||
|
|
||
| //selectFrag.append(" ? AS SourceName\n").add(getName()); | ||
| selectFrag.append(" ").append(_table.getSchema().getSqlDialect().getStringHandler().quoteStringLiteral(getSourceName())).append(" AS SourceName\n"); |
There was a problem hiding this comment.
I'm not exactly sure what's going on here (selecing a bit of SQL as a string value?), but can we just do .appendValue(getSourceName())?
|
|
||
| public String getSourceSelect(SqlDialect sqlDialect) | ||
| { | ||
| String schema = sqlDialect.makeLegalIdentifier(_table.getSchema().getName()); |
There was a problem hiding this comment.
This doesn't really have anything to do with SQLFragment and identifiers, if we're just trying to create a string literal to select. Just create the string you want and use appendValue() instead of append()
| String schema = sqlDialect.makeLegalIdentifier(_table.getSchema().getName()); | ||
| String table = sqlDialect.makeLegalIdentifier(_table.getName()); | ||
| String column = sqlDialect.makeLegalIdentifier(_pathColumn.getName()); | ||
| return sqlDialect.getStringHandler().quoteStringLiteral(schema + "." + table + "." + column); |
There was a problem hiding this comment.
Maybe use
// for Db schema table info
return table.getSelectName() + "." + LabKeySql.quoteString(_pathColumn.getName())
// for UserSchema
return table.getUserSchema().getSchemaPath().toSQLString() + "." + LabKeySql.quoteString(_table.getName()) + "." + LabkeySql.quoteString(_pathColumn.getName()
and then appendValue() as mentioned above.
Rationale
Issue 52900: LKSM: Moving a sample to another folder breaks other references to shared files
Issue 53070: Moving files could result in duplicate exp.data records
Issue 53178: SQL generation problem from TableUpdaterFileListener
Related Pull Requests
Changes